<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>测试练习</title>
</head>

<body>
  <h3>测试练习</h3>
</body>
<script>
  let obj1 = { a: 1 }
  let obj2 = {}
  console.log(JSON.stringify(obj1));
  console.log(JSON.stringify(obj2));
  if (JSON.stringify(obj1) === '{}') {
    console.log('true', '对象为空');
  } else {
    console.log('false', '对象不为空');
  }
</script>

</html>